package com.wisdytech.linkdcs.energy.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageInfo;
import com.wisdytech.common.bean.Filter;
import com.wisdytech.common.handler.BaseService;
import com.wisdytech.linkdcs.energy.dao.IEqEnergyRecordDao;
import com.wisdytech.linkdcs.energy.model.EquipmentEnergyRecord;
import com.wisdytech.linkdcs.energy.service.IEquipmentEnergyRecordService;

/**
 * 
 * <p>
 * ClassName: EquipmentEnergyRecordServiceImpl
 * </p>
 * <p>
 * Description: 
 * </p>
 * <p>
 * Author: kongming
 * </p>
 * <p>
 * Date: 2017-10-16
 * </p>
 */
@Service("equipmentEnergyRecordService")
@Transactional
public class EquipmentEnergyRecordServiceImpl extends BaseService<IEqEnergyRecordDao, EquipmentEnergyRecord> implements IEquipmentEnergyRecordService{

    @Override
    public PageInfo<EquipmentEnergyRecord> listEquipmentEnergyRecordByFilter(String code, String startTime,
            String endTime,String operationId, Filter filter) {
        Map<String, Object> queryMap = new HashMap<String, Object>();
        queryMap.put("code", code);
        queryMap.put("startTime", startTime);
        queryMap.put("endTime", endTime);
        queryMap.put("operationId", operationId);
        List<EquipmentEnergyRecord> lists =
                super.beforeList(IEqEnergyRecordDao.class, filter).selectEnergyRecordPage(queryMap);
        PageInfo<EquipmentEnergyRecord> energyRecordPage=new PageInfo<>(lists);
        return energyRecordPage;
    }

}
